﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Reflection.Emit;
using Kawanon.Usability;

namespace TestUnit
{
	public partial class Form1 : Form
	{
		public Form1()
		{
			InitializeComponent();
		}

		private void Form1_Load(object sender, EventArgs e)
		{
			Kawanon.QtHoney.MainPlugin.Uninstall();

			Kawanon.QtHoney.NListView nw = new Kawanon.QtHoney.NListView();
			nw.AssignHandle(listView1.Handle);

			//Form form = new Kawanon.QtHoney.GestureForm();
			//form.Show(this);

			nw.StatusBarHandle = statusBar1.Handle;

			//Kawanon.QtHoney.DebugForm f2 = new Kawanon.QtHoney.DebugForm();
			//f2.PropertyGrid.SelectedObject = f2;
			//f2.Show();

			//----
			//object o = Kawanon.QtHoney.DynamicReflectorFactory.Create(f2);
			//f2.PropertyGrid.SelectedObject = o;

			//Kawanon.QtHoney.MainPlugin plugin = new Kawanon.QtHoney.MainPlugin();
			//plugin.GetImage(true, 0);

			Kawanon.QtHoney.PluginCustomItem item = new Kawanon.QtHoney.PluginItems.MergeWindowsButton();
			Image image = item.GetImage(true);

			image.ToString();

		}

		private void ToolStripMenuItem_GestureForm_Click(object sender, EventArgs e)
		{
			Kawanon.QtHoney.GestureForm form = new Kawanon.QtHoney.GestureForm(null);
			form.Show(this);

		}

		private void menuItem1_Click(object sender, EventArgs e)
		{
			Kawanon.QtHoney.GestureForm form = new Kawanon.QtHoney.GestureForm(null);
			form.Show(this);
		}

		private void Form1_FormClosing(object sender, FormClosingEventArgs e)
		{
			List<GestureExpression> list = new List<GestureExpression>();
			GestureSettings.LoadExpressions(list);

			GestureSettings.DumpExpressions(list);
		}

		private void Form1_Activated(object sender, EventArgs e)
		{
			ToolTip tooltip = new ToolTip();
			//tooltip.AutoPopDelay = 32767;
			//		tooltip.IsBalloon = true;
			//tooltip.Active = true;
			//	tooltip.UseFading = true;
			//tooltip.ShowAlways = true;
			//	tooltip.ToolTipTitle = "hoge!";
			//Dbg.Play();
			//tooltip.SetToolTip(listView1, "hoge");
			tooltip.Show("hoge", Control.FromHandle(this.Handle), 0, 0, 20 * 1000);

		}
	}
}
